﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Skill.Ode.Geometries;

namespace Samples
{
    #region VertexPositionNormalColor
    /// <summary>
    /// Defines vertex that contain Position, Normal and color data
    /// </summary>
    public struct VertexPositionNormalColor
    {
        #region Variables
        /// <summary>
        /// Position
        /// </summary>
        public Vector3 Position;
        /// <summary>
        /// Normal
        /// </summary>
        public Vector3 Normal;
        /// <summary>
        /// Color
        /// </summary>
        public Color Color;
        #endregion

        #region Static constructor
        /// <summary>
        /// Static constructor
        /// </summary>
        static VertexPositionNormalColor()
        {
            VertexElements = new VertexElement[]
            {
                new VertexElement(0,0, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position,0),
                new VertexElement(0,12, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Normal,0),
                new VertexElement(0,24, VertexElementFormat.Color, VertexElementMethod.Default, VertexElementUsage.Color,0)
            };
        }
        #endregion

        #region Static variables
        /// <summary>
        /// VertexElements 
        /// </summary>
        public static VertexElement[] VertexElements;

        /// <summary>
        /// SizeInBytes = 28
        /// </summary>
        public static int SizeInBytes { get { return 28; } }
        #endregion
    }
    #endregion

    #region DisplayString
    /// <summary>
    /// Defines info to draw text
    /// </summary>
    public class DisplayString
    {
        /// <summary>
        /// Text
        /// </summary>
        public string Text { get; set; }
        /// <summary>
        /// Position in screen
        /// </summary>
        public Vector2 Position { get; set; }
        /// <summary>
        /// Color
        /// </summary>
        public Color Color { get; set; }
    }
    #endregion

    #region DisplayLine
    /// <summary>
    /// Defines info to draw line
    /// </summary>
    public class DisplayLine
    {
        /// <summary>
        /// Start of line
        /// </summary>
        public Vector3 From { get; set; }
        /// <summary>
        /// End of line
        /// </summary>
        public Vector3 To { get; set; }
        /// <summary>
        /// Color
        /// </summary>
        public Color Color { get; set; }
    }
    #endregion

    #region DisplayGeometry
    /// <summary>
    /// Defines info to draw mesh
    /// </summary>
    public abstract class DisplayGeometry : IDisposable
    {
        #region Static variables
        //Box
        //**************************************************
        protected static int[] BoxIndices = new int[]{1,2,3,0,1,3,4,7,6,5,4,6,3,7,4,0,3,4,5,6,2,
   1,5,2,2,6,7,3,2,7,4,5,1,0,4,1};

        protected static VertexPositionNormalColor[] BoxVertices = new VertexPositionNormalColor[]{
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5773503f,0.5773503f,0.5773503f), Position = new Vector3(-1f,1f,1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3333333f,0.6666667f,0.6666667f), Position = new Vector3(1f,1f,1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6666667f,-0.6666667f,0.3333333f), Position = new Vector3(1f,-1f,1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6666667f,-0.3333333f,0.6666667f), Position = new Vector3(-1f,-1f,1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5773503f,0.5773503f,-0.5773503f), Position = new Vector3(-1f,1f,-1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8164966f,0.4082483f,-0.4082483f), Position = new Vector3(1f,1f,-1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4082483f,-0.4082483f,-0.8164966f), Position = new Vector3(1f,-1f,-1f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4082483f,-0.8164966f,-0.4082483f), Position = new Vector3(-1f,-1f,-1f) }
};

        //**************************************************
        //**************************************************
        //Capsule
        //**************************************************
        protected static int[] CapsuleIndices = new int[]{2,1,0,3,2,0,4,3,0,5,4,0,6,5,0,1,6,0,8,7,1,
   8,1,2,9,8,2,9,2,3,10,9,3,10,3,4,11,10,4,11,4,
   5,12,11,5,12,5,6,7,12,6,7,6,1,14,13,7,14,7,8,15,
   14,8,15,8,9,16,15,9,16,9,10,17,16,10,17,10,11,18,17,11,
   18,11,12,13,18,12,13,12,7,20,19,13,20,13,14,21,20,14,21,14,
   15,22,21,15,22,15,16,23,22,16,23,16,17,24,23,17,24,17,18,19,
   24,18,19,18,13,26,25,19,26,19,20,27,26,20,27,20,21,28,27,21,
   28,21,22,29,28,22,29,22,23,30,29,23,30,23,24,25,30,24,25,24,
   19,32,31,25,32,25,26,33,32,26,33,26,27,34,33,27,34,27,28,35,
   34,28,35,28,29,36,35,29,36,29,30,31,36,30,31,30,25,38,37,31,
   38,31,32,39,38,32,39,32,33,40,39,33,40,33,34,41,40,34,41,34,
   35,42,41,35,42,35,36,37,42,36,37,36,31,43,37,38,43,38,39,43,
   39,40,43,40,41,43,41,42,43,42,37};

        protected static VertexPositionNormalColor[] CapsuleVertices = new VertexPositionNormalColor[]{
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-7.456099E-08f,-1f,4.014823E-08f), Position = new Vector3(0f,-1f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.1262764f,-0.8162628f,0.5637102f), Position = new Vector3(0f,-0.9330127f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5513256f,-0.8162627f,0.1724966f), Position = new Vector3(-0.2165063f,-0.9330127f,0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4250493f,-0.8162628f,-0.3912136f), Position = new Vector3(-0.2165063f,-0.9330127f,-0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.1262764f,-0.8162628f,-0.5637103f), Position = new Vector3(2.185569E-08f,-0.9330127f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5513256f,-0.8162628f,-0.1724967f), Position = new Vector3(0.2165063f,-0.9330127f,-0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4250492f,-0.8162628f,0.3912137f), Position = new Vector3(0.2165063f,-0.9330127f,0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.07350823f,-0.4751646f,0.876821f), Position = new Vector3(0f,-0.75f,0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7961034f,-0.4751647f,0.3747505f), Position = new Vector3(-0.375f,-0.75f,0.2165063f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7225951f,-0.4751647f,-0.5020705f), Position = new Vector3(-0.375f,-0.75f,-0.2165064f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.0735083f,-0.4751647f,-0.876821f), Position = new Vector3(3.785517E-08f,-0.75f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7961034f,-0.4751647f,-0.3747506f), Position = new Vector3(0.375f,-0.75f,-0.2165063f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7225951f,-0.4751647f,0.5020705f), Position = new Vector3(0.375f,-0.75f,0.2165063f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.07337002f,-0.08606145f,0.9935846f), Position = new Vector3(0f,-0.5f,0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8971545f,-0.08606143f,0.433252f), Position = new Vector3(-0.4330127f,-0.5f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8237844f,-0.08606142f,-0.5603326f), Position = new Vector3(-0.4330127f,-0.5f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.07337013f,-0.08606143f,-0.9935846f), Position = new Vector3(4.371139E-08f,-0.5f,-0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8971545f,-0.08606145f,-0.4332521f), Position = new Vector3(0.4330128f,-0.5f,-0.2499999f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8237844f,-0.08606146f,0.5603327f), Position = new Vector3(0.4330128f,-0.5f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0f,1f), Position = new Vector3(0f,0f,0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8660254f,0f,0.5f), Position = new Vector3(-0.4330127f,0f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8660254f,0f,-0.5f), Position = new Vector3(-0.4330127f,0f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(1.032383E-07f,0f,-1f), Position = new Vector3(4.371139E-08f,0f,-0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8660253f,0f,-0.5f), Position = new Vector3(0.4330128f,0f,-0.2499999f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8660253f,0f,0.5000001f), Position = new Vector3(0.4330128f,0f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.07337002f,0.08606143f,0.9935846f), Position = new Vector3(0f,0.5f,0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8237845f,0.08606142f,0.5603325f), Position = new Vector3(-0.4330127f,0.5f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8971545f,0.08606143f,-0.433252f), Position = new Vector3(-0.4330127f,0.5f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.07336993f,0.08606143f,-0.9935846f), Position = new Vector3(4.371139E-08f,0.5f,-0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8237844f,0.08606144f,-0.5603326f), Position = new Vector3(0.4330128f,0.5f,-0.2499999f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8971545f,0.08606146f,0.4332521f), Position = new Vector3(0.4330128f,0.5f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.07350823f,0.4751647f,0.8768209f), Position = new Vector3(0f,0.75f,0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7225952f,0.4751647f,0.5020705f), Position = new Vector3(-0.375f,0.75f,0.2165063f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7961034f,0.4751647f,-0.3747506f), Position = new Vector3(-0.375f,0.75f,-0.2165064f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.07350814f,0.4751647f,-0.876821f), Position = new Vector3(3.785517E-08f,0.75f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7225952f,0.4751646f,-0.5020705f), Position = new Vector3(0.375f,0.75f,-0.2165063f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7961034f,0.4751647f,0.3747506f), Position = new Vector3(0.375f,0.75f,0.2165063f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.1262763f,0.8162628f,0.5637102f), Position = new Vector3(0f,0.9330127f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4250493f,0.8162628f,0.3912137f), Position = new Vector3(-0.2165063f,0.9330127f,0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5513255f,0.8162628f,-0.1724966f), Position = new Vector3(-0.2165063f,0.9330127f,-0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.1262763f,0.8162628f,-0.5637102f), Position = new Vector3(2.185569E-08f,0.9330127f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4250493f,0.8162627f,-0.3912136f), Position = new Vector3(0.2165063f,0.9330127f,-0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5513256f,0.8162628f,0.1724967f), Position = new Vector3(0.2165063f,0.9330127f,0.125f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-7.456099E-08f,1f,4.014823E-08f), Position = new Vector3(0f,1f,0f) }
};

        //**************************************************
        //**************************************************
        //Cone
        //**************************************************
        protected static int[] ConeIndices = new int[] { 0, 1, 6, 1, 2, 6, 2, 3, 6, 3, 4, 6, 4, 5, 6, 5, 0, 6 };

        protected static VertexPositionNormalColor[] ConeVertices = new VertexPositionNormalColor[]{
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7071066f,-0.7071069f,-1.216675E-08f), Position = new Vector3(0.7071068f,1.207107f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3535533f,-0.7071068f,-0.6123723f), Position = new Vector3(0.3535534f,1.207107f,-0.6123725f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3535534f,-0.7071069f,-0.6123723f), Position = new Vector3(-0.3535534f,1.207107f,-0.6123724f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7071067f,-0.7071068f,8.516725E-08f), Position = new Vector3(-0.7071067f,1.207107f,6.35359E-08f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3535533f,-0.7071068f,0.6123725f), Position = new Vector3(-0.3535533f,1.207107f,0.6123724f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3535534f,-0.7071068f,0.6123724f), Position = new Vector3(0.3535534f,1.207107f,0.6123723f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(1.147092E-08f,-0.9999999f,5.73546E-09f), Position = new Vector3(0f,0.5f,0f) }
};

        //**************************************************
        //**************************************************
        //Cylinder
        //**************************************************
        protected static int[] CylinderIndices = new int[]{3,5,2,6,5,3,4,6,3,7,6,4,6,8,5,9,8,6,7,9,6,
   10,9,7,9,11,8,12,11,9,10,12,9,13,12,10,12,14,11,15,14,
   12,13,15,12,16,15,13,15,17,14,18,17,15,16,18,15,19,18,16,18,
   2,17,3,2,18,19,3,18,4,3,19,2,5,0,5,8,0,8,11,0,
   11,14,0,14,17,0,17,2,0,7,4,1,10,7,1,13,10,1,16,13,
   1,19,16,1,4,19,1};

        protected static VertexPositionNormalColor[] CylinderVertices = new VertexPositionNormalColor[]{
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-1f,0f), Position = new Vector3(0f,-0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,1f,0f), Position = new Vector3(0f,0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8215838f,-0.5477226f,0.158114f), Position = new Vector3(0.5f,-0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(1f,0f,9.176738E-08f), Position = new Vector3(0.5f,0f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8215839f,0.5477226f,-0.1581139f), Position = new Vector3(0.5f,0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5477226f,-0.5477226f,-0.6324556f), Position = new Vector3(0.25f,-0.5f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5f,0f,-0.8660254f), Position = new Vector3(0.25f,0f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2738612f,0.5477225f,-0.7905694f), Position = new Vector3(0.25f,0.5f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2738613f,-0.5477225f,-0.7905694f), Position = new Vector3(-0.25f,-0.5f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5f,0f,-0.8660254f), Position = new Vector3(-0.25f,0f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5477226f,0.5477225f,-0.6324555f), Position = new Vector3(-0.25f,0.5f,-0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8215839f,-0.5477226f,-0.1581139f), Position = new Vector3(-0.5f,-0.5f,2.580957E-08f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9999999f,0f,4.588368E-08f), Position = new Vector3(-0.5f,0f,2.580957E-08f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8215838f,0.5477226f,0.1581139f), Position = new Vector3(-0.5f,0.5f,2.580957E-08f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5477225f,-0.5477225f,0.6324556f), Position = new Vector3(-0.25f,-0.5f,0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4999999f,0f,0.8660254f), Position = new Vector3(-0.25f,0f,0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2738612f,0.5477225f,0.7905694f), Position = new Vector3(-0.25f,0.5f,0.4330127f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2738613f,-0.5477225f,0.7905695f), Position = new Vector3(0.2499999f,-0.5f,0.4330126f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5f,0f,0.8660254f), Position = new Vector3(0.2499999f,0f,0.4330126f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5477225f,0.5477225f,0.6324557f), Position = new Vector3(0.2499999f,0.5f,0.4330126f) }
};

        //**************************************************
        //**************************************************
        //Sphere
        //**************************************************
        protected static int[] SphereIndices = new int[]{26,25,24,41,40,39,56,55,54,71,70,69,86,85,84,101,100,99,116,115,114,
   131,130,129,146,145,144,161,160,159,176,175,174,191,190,189,206,205,204,221,220,
   219,236,235,234,251,250,249,266,265,264,281,280,279,296,295,294,311,310,309,17,
   16,15,20,19,18,23,22,21,17,15,1,16,12,15,14,16,17,20,18,12,
   19,4,18,13,19,20,23,21,14,22,13,21,0,22,23,26,24,12,25,13,
   24,14,25,26,32,31,30,35,34,33,38,37,36,32,30,4,31,27,30,29,
   31,32,35,33,27,34,9,33,28,34,35,38,36,29,37,28,36,0,37,38,
   41,39,27,40,28,39,29,40,41,47,46,45,50,49,48,53,52,51,47,45,
   4,46,42,45,44,46,47,50,48,42,49,5,48,43,49,50,53,51,44,52,
   43,51,9,52,53,56,54,42,55,43,54,44,55,56,62,61,60,65,64,63,
   68,67,66,62,60,8,61,57,60,59,61,62,65,63,57,64,5,63,58,64,
   65,68,66,59,67,58,66,4,67,68,71,69,57,70,58,69,59,70,71,77,
   76,75,80,79,78,83,82,81,77,75,1,76,72,75,74,76,77,80,78,72,
   79,8,78,73,79,80,83,81,74,82,73,81,4,82,83,86,84,72,85,73,
   84,74,85,86,92,91,90,95,94,93,98,97,96,92,90,1,91,87,90,89,
   91,92,95,93,87,94,10,93,88,94,95,98,96,89,97,88,96,8,97,98,
   101,99,87,100,88,99,89,100,101,107,106,105,110,109,108,113,112,111,107,105,
   10,106,102,105,104,106,107,110,108,102,109,3,108,103,109,110,113,111,104,112,
   103,111,8,112,113,116,114,102,115,103,114,104,115,116,122,121,120,125,124,123,
   128,127,126,122,120,8,121,117,120,119,121,122,125,123,117,124,3,123,118,124,
   125,128,126,119,127,118,126,5,127,128,131,129,117,130,118,129,119,130,131,137,
   136,135,140,139,138,143,142,141,137,135,3,136,132,135,134,136,137,140,138,132,
   139,2,138,133,139,140,143,141,134,142,133,141,5,142,143,146,144,132,145,133,
   144,134,145,146,152,151,150,155,154,153,158,157,156,152,150,3,151,147,150,149,
   151,152,155,153,147,154,7,153,148,154,155,158,156,149,157,148,156,2,157,158,
   161,159,147,160,148,159,149,160,161,167,166,165,170,169,168,173,172,171,167,165,
   3,166,162,165,164,166,167,170,168,162,169,10,168,163,169,170,173,171,164,172,
   163,171,7,172,173,176,174,162,175,163,174,164,175,176,182,181,180,185,184,183,
   188,187,186,182,180,10,181,177,180,179,181,182,185,183,177,184,6,183,178,184,
   185,188,186,179,187,178,186,7,187,188,191,189,177,190,178,189,179,190,191,197,
   196,195,200,199,198,203,202,201,197,195,6,196,192,195,194,196,197,200,198,192,
   199,11,198,193,199,200,203,201,194,202,193,201,7,202,203,206,204,192,205,193,
   204,194,205,206,212,211,210,215,214,213,218,217,216,212,210,6,211,207,210,209,
   211,212,215,213,207,214,0,213,208,214,215,218,216,209,217,208,216,11,217,218,
   221,219,207,220,208,219,209,220,221,227,226,225,230,229,228,233,232,231,227,225,
   6,226,222,225,224,226,227,230,228,222,229,1,228,223,229,230,233,231,224,232,
   223,231,0,232,233,236,234,222,235,223,234,224,235,236,242,241,240,245,244,243,
   248,247,246,242,240,10,241,237,240,239,241,242,245,243,237,244,1,243,238,244,
   245,248,246,239,247,238,246,6,247,248,251,249,237,250,238,249,239,250,251,257,
   256,255,260,259,258,263,262,261,257,255,11,256,252,255,254,256,257,260,258,252,
   259,0,258,253,259,260,263,261,254,262,253,261,9,262,263,266,264,252,265,253,
   264,254,265,266,272,271,270,275,274,273,278,277,276,272,270,2,271,267,270,269,
   271,272,275,273,267,274,11,273,268,274,275,278,276,269,277,268,276,9,277,278,
   281,279,267,280,268,279,269,280,281,287,286,285,290,289,288,293,292,291,287,285,
   5,286,282,285,284,286,287,290,288,282,289,2,288,283,289,290,293,291,284,292,
   283,291,9,292,293,296,294,282,295,283,294,284,295,296,302,301,300,305,304,303,
   308,307,306,302,300,11,301,297,300,299,301,302,305,303,297,304,2,303,298,304,
   305,308,306,299,307,298,306,7,307,308,311,309,297,310,298,309,299,310,311};

        protected static VertexPositionNormalColor[] SphereVertices = new VertexPositionNormalColor[]{
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.525731f,-2.622714E-09f,0.8506509f), Position = new Vector3(-0.2628655f,0f,0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.525731f,-2.622714E-09f,0.8506509f), Position = new Vector3(0.2628655f,0f,0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.525731f,0f,-0.8506508f), Position = new Vector3(-0.2628655f,0f,-0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.525731f,-2.622714E-09f,-0.8506508f), Position = new Vector3(0.2628655f,0f,-0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(2.622714E-09f,0.8506508f,0.525731f), Position = new Vector3(0f,0.4253254f,0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.8506509f,-0.525731f), Position = new Vector3(0f,0.4253254f,-0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.8506509f,0.525731f), Position = new Vector3(0f,-0.4253254f,0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-2.622714E-09f,-0.8506508f,-0.525731f), Position = new Vector3(0f,-0.4253254f,-0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8506508f,0.525731f,-2.622714E-09f), Position = new Vector3(0.4253254f,0.2628655f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8506508f,0.525731f,-2.622714E-09f), Position = new Vector3(-0.4253254f,0.2628655f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8506509f,-0.525731f,0f), Position = new Vector3(0.4253254f,-0.2628655f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8506508f,-0.525731f,-2.622714E-09f), Position = new Vector3(-0.4253254f,-0.2628655f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2003176f,0.4551857f,0.8675708f), Position = new Vector3(0.1545085f,0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2003176f,0.4551857f,0.8675708f), Position = new Vector3(-0.1545085f,0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.1310647f,0.9913738f), Position = new Vector3(0f,0f,0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3355902f,0.2077005f,0.9188252f), Position = new Vector3(0.2169443f,0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2489917f,0.2074637f,0.9460244f), Position = new Vector3(0.08122993f,0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2836944f,0.123731f,0.9508986f), Position = new Vector3(0.1366332f,0f,0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05189585f,0.6667276f,0.7434924f), Position = new Vector3(0.08031102f,0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05189585f,0.6667277f,0.7434924f), Position = new Vector3(-0.08031102f,0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.6103406f,0.7921391f), Position = new Vector3(0f,0.2628655f,0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2489917f,0.2074637f,0.9460243f), Position = new Vector3(-0.08122993f,0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3355901f,0.2077004f,0.9188253f), Position = new Vector3(-0.2169443f,0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2836944f,0.123731f,0.9508987f), Position = new Vector3(-0.1366332f,0f,0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.4117133f,0.9113134f), Position = new Vector3(0f,0.2628655f,0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05147159f,0.3284305f,0.9431247f), Position = new Vector3(-0.08122993f,0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05147159f,0.3284305f,0.9431247f), Position = new Vector3(0.08122993f,0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5361882f,0.7365059f,0.412385f), Position = new Vector3(-0.25f,0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7365059f,0.412385f,0.5361882f), Position = new Vector3(-0.4045085f,0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.412385f,0.5361882f,0.7365059f), Position = new Vector3(-0.1545085f,0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2841708f,0.7950938f,0.5357918f), Position = new Vector3(-0.1299459f,0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3356836f,0.7385604f,0.5846751f), Position = new Vector3(-0.2126627f,0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2520974f,0.7431979f,0.6197611f), Position = new Vector3(-0.08031102f,0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7431979f,0.6197611f,0.2520974f), Position = new Vector3(-0.3510232f,0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7950938f,0.5357918f,0.2841708f), Position = new Vector3(-0.4313343f,0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7385604f,0.5846751f,0.3356836f), Position = new Vector3(-0.3440955f,0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5846751f,0.3356836f,0.7385604f), Position = new Vector3(-0.2938926f,0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6197611f,0.2520974f,0.7431979f), Position = new Vector3(-0.3468902f,0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5357918f,0.2841708f,0.7950939f), Position = new Vector3(-0.2169443f,0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6146943f,0.5828831f,0.5314114f), Position = new Vector3(-0.3440955f,0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5828831f,0.5314114f,0.6146943f), Position = new Vector3(-0.2938926f,0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5314115f,0.6146943f,0.5828831f), Position = new Vector3(-0.2126627f,0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.1310647f,0.9913738f,0f), Position = new Vector3(0f,0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4551857f,0.8675708f,-0.2003176f), Position = new Vector3(-0.25f,0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4551857f,0.8675708f,0.2003176f), Position = new Vector3(-0.25f,0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.123731f,0.9508986f,0.2836944f), Position = new Vector3(0f,0.4809691f,0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2074637f,0.9460243f,0.2489917f), Position = new Vector3(-0.1314328f,0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2077005f,0.9188252f,0.3355902f), Position = new Vector3(-0.1299459f,0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.123731f,0.9508987f,-0.2836944f), Position = new Vector3(0f,0.4809691f,-0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2077005f,0.9188252f,-0.3355902f), Position = new Vector3(-0.1299459f,0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2074637f,0.9460243f,-0.2489917f), Position = new Vector3(-0.1314328f,0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6103406f,0.7921391f,0f), Position = new Vector3(-0.2628655f,0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6667276f,0.7434924f,-0.05189585f), Position = new Vector3(-0.3510232f,0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6667276f,0.7434924f,0.05189585f), Position = new Vector3(-0.3510232f,0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3284304f,0.9431247f,-0.05147159f), Position = new Vector3(-0.1314328f,0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4117133f,0.9113134f,0f), Position = new Vector3(-0.2628655f,0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3284304f,0.9431247f,0.05147159f), Position = new Vector3(-0.1314328f,0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4551857f,0.8675708f,-0.2003176f), Position = new Vector3(0.25f,0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.1310647f,0.9913738f,0f), Position = new Vector3(0f,0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4551857f,0.8675708f,0.2003176f), Position = new Vector3(0.25f,0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6667277f,0.7434924f,-0.05189585f), Position = new Vector3(0.3510232f,0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6103406f,0.7921391f,0f), Position = new Vector3(0.2628655f,0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6667277f,0.7434924f,0.05189585f), Position = new Vector3(0.3510232f,0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2077004f,0.9188253f,-0.3355901f), Position = new Vector3(0.1299459f,0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.123731f,0.9508986f,-0.2836944f), Position = new Vector3(0f,0.4809691f,-0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2074637f,0.9460244f,-0.2489917f), Position = new Vector3(0.1314328f,0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2074637f,0.9460244f,0.2489917f), Position = new Vector3(0.1314328f,0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.123731f,0.9508987f,0.2836944f), Position = new Vector3(0f,0.4809691f,0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2077004f,0.9188253f,0.3355901f), Position = new Vector3(0.1299459f,0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3284305f,0.9431247f,-0.05147159f), Position = new Vector3(0.1314328f,0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3284304f,0.9431247f,0.05147159f), Position = new Vector3(0.1314328f,0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4117133f,0.9113134f,0f), Position = new Vector3(0.2628655f,0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7365059f,0.412385f,0.5361882f), Position = new Vector3(0.4045085f,0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5361882f,0.7365059f,0.412385f), Position = new Vector3(0.25f,0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.412385f,0.5361882f,0.7365059f), Position = new Vector3(0.1545085f,0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6197611f,0.2520974f,0.7431979f), Position = new Vector3(0.3468902f,0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5846751f,0.3356836f,0.7385604f), Position = new Vector3(0.2938926f,0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5357918f,0.2841708f,0.7950938f), Position = new Vector3(0.2169443f,0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7950939f,0.5357918f,0.2841708f), Position = new Vector3(0.4313343f,0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7431979f,0.6197611f,0.2520974f), Position = new Vector3(0.3510232f,0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7385604f,0.5846751f,0.3356836f), Position = new Vector3(0.3440955f,0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3356836f,0.7385604f,0.5846751f), Position = new Vector3(0.2126627f,0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2841708f,0.7950939f,0.5357918f), Position = new Vector3(0.1299459f,0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2520974f,0.7431979f,0.6197611f), Position = new Vector3(0.08031102f,0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6146943f,0.5828831f,0.5314115f), Position = new Vector3(0.3440955f,0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5314115f,0.6146943f,0.5828831f), Position = new Vector3(0.2126627f,0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5828831f,0.5314114f,0.6146943f), Position = new Vector3(0.2938926f,0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8675708f,-0.2003176f,0.4551857f), Position = new Vector3(0.4045085f,-0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9913738f,0f,0.1310647f), Position = new Vector3(0.5f,0f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8675708f,0.2003176f,0.4551857f), Position = new Vector3(0.4045085f,0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7434924f,-0.05189585f,0.6667277f), Position = new Vector3(0.3468902f,-0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7921391f,0f,0.6103406f), Position = new Vector3(0.4253254f,0f,0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7434924f,0.05189585f,0.6667277f), Position = new Vector3(0.3468902f,0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9188253f,-0.3355901f,0.2077004f), Position = new Vector3(0.4313343f,-0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9508986f,-0.2836944f,0.123731f), Position = new Vector3(0.4809691f,-0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9460244f,-0.2489917f,0.2074637f), Position = new Vector3(0.4755283f,-0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9460244f,0.2489917f,0.2074637f), Position = new Vector3(0.4755283f,0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9508987f,0.2836944f,0.123731f), Position = new Vector3(0.4809691f,0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9188253f,0.3355901f,0.2077004f), Position = new Vector3(0.4313343f,0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9431247f,-0.05147159f,0.3284305f), Position = new Vector3(0.4755283f,-0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9431247f,0.05147159f,0.3284304f), Position = new Vector3(0.4755283f,0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9113134f,0f,0.4117133f), Position = new Vector3(0.4253254f,0f,0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8675708f,-0.2003176f,-0.4551857f), Position = new Vector3(0.4045085f,-0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.8675708f,0.2003176f,-0.4551857f), Position = new Vector3(0.4045085f,0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9913738f,0f,-0.1310647f), Position = new Vector3(0.5f,0f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9188252f,-0.3355902f,-0.2077005f), Position = new Vector3(0.4313343f,-0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9460244f,-0.2489917f,-0.2074637f), Position = new Vector3(0.4755283f,-0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9508986f,-0.2836944f,-0.123731f), Position = new Vector3(0.4809691f,-0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7434924f,-0.05189585f,-0.6667276f), Position = new Vector3(0.3468902f,-0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7434924f,0.05189585f,-0.6667277f), Position = new Vector3(0.3468902f,0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7921391f,0f,-0.6103406f), Position = new Vector3(0.4253254f,0f,-0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9460243f,0.2489917f,-0.2074637f), Position = new Vector3(0.4755283f,0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9188253f,0.3355901f,-0.2077004f), Position = new Vector3(0.4313343f,0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9508987f,0.2836944f,-0.123731f), Position = new Vector3(0.4809691f,0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9113134f,0f,-0.4117133f), Position = new Vector3(0.4253254f,0f,-0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9431247f,0.05147159f,-0.3284305f), Position = new Vector3(0.4755283f,0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.9431247f,-0.05147159f,-0.3284305f), Position = new Vector3(0.4755283f,-0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7365059f,0.412385f,-0.5361882f), Position = new Vector3(0.4045085f,0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.412385f,0.5361882f,-0.7365059f), Position = new Vector3(0.1545085f,0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5361882f,0.7365059f,-0.412385f), Position = new Vector3(0.25f,0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7950938f,0.5357918f,-0.2841708f), Position = new Vector3(0.4313343f,0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7385604f,0.5846751f,-0.3356836f), Position = new Vector3(0.3440955f,0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7431979f,0.6197611f,-0.2520974f), Position = new Vector3(0.3510232f,0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6197611f,0.2520974f,-0.7431979f), Position = new Vector3(0.3468902f,0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5357918f,0.2841708f,-0.7950938f), Position = new Vector3(0.2169443f,0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5846751f,0.3356836f,-0.7385604f), Position = new Vector3(0.2938926f,0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3356836f,0.7385604f,-0.5846751f), Position = new Vector3(0.2126627f,0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2520974f,0.7431979f,-0.6197611f), Position = new Vector3(0.08031102f,0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2841708f,0.7950939f,-0.5357918f), Position = new Vector3(0.1299459f,0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5828831f,0.5314114f,-0.6146943f), Position = new Vector3(0.2938926f,0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5314114f,0.6146943f,-0.5828831f), Position = new Vector3(0.2126627f,0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6146943f,0.5828831f,-0.5314115f), Position = new Vector3(0.3440955f,0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.1310647f,-0.9913738f), Position = new Vector3(0f,0f,-0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2003176f,0.4551857f,-0.8675708f), Position = new Vector3(-0.1545085f,0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2003176f,0.4551857f,-0.8675708f), Position = new Vector3(0.1545085f,0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2836944f,0.123731f,-0.9508986f), Position = new Vector3(0.1366332f,0f,-0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2489917f,0.2074637f,-0.9460243f), Position = new Vector3(0.08122993f,0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3355902f,0.2077005f,-0.9188252f), Position = new Vector3(0.2169443f,0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2836944f,0.123731f,-0.9508987f), Position = new Vector3(-0.1366332f,0f,-0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3355902f,0.2077005f,-0.9188252f), Position = new Vector3(-0.2169443f,0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2489917f,0.2074637f,-0.9460243f), Position = new Vector3(-0.08122993f,0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.6103406f,-0.7921391f), Position = new Vector3(0f,0.2628655f,-0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05189585f,0.6667276f,-0.7434924f), Position = new Vector3(-0.08031102f,0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05189585f,0.6667276f,-0.7434924f), Position = new Vector3(0.08031102f,0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05147159f,0.3284304f,-0.9431247f), Position = new Vector3(-0.08122993f,0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,0.4117133f,-0.9113134f), Position = new Vector3(0f,0.2628655f,-0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05147159f,0.3284304f,-0.9431247f), Position = new Vector3(0.08122993f,0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2003176f,-0.4551857f,-0.8675708f), Position = new Vector3(0.1545085f,-0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2003176f,-0.4551857f,-0.8675708f), Position = new Vector3(-0.1545085f,-0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.1310647f,-0.9913738f), Position = new Vector3(0f,0f,-0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3355902f,-0.2077005f,-0.9188252f), Position = new Vector3(0.2169443f,-0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2489917f,-0.2074637f,-0.9460244f), Position = new Vector3(0.08122993f,-0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2836944f,-0.123731f,-0.9508986f), Position = new Vector3(0.1366332f,0f,-0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05189585f,-0.6667276f,-0.7434924f), Position = new Vector3(0.08031102f,-0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05189585f,-0.6667277f,-0.7434924f), Position = new Vector3(-0.08031102f,-0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.6103406f,-0.7921391f), Position = new Vector3(0f,-0.2628655f,-0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2489917f,-0.2074637f,-0.9460243f), Position = new Vector3(-0.08122993f,-0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3355901f,-0.2077004f,-0.9188253f), Position = new Vector3(-0.2169443f,-0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2836944f,-0.123731f,-0.9508987f), Position = new Vector3(-0.1366332f,0f,-0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.4117133f,-0.9113134f), Position = new Vector3(0f,-0.2628655f,-0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05147159f,-0.3284305f,-0.9431247f), Position = new Vector3(-0.08122993f,-0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05147159f,-0.3284305f,-0.9431247f), Position = new Vector3(0.08122993f,-0.1314328f,-0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7365059f,-0.412385f,-0.5361882f), Position = new Vector3(0.4045085f,-0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5361882f,-0.7365059f,-0.412385f), Position = new Vector3(0.25f,-0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.412385f,-0.5361882f,-0.7365059f), Position = new Vector3(0.1545085f,-0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6197611f,-0.2520974f,-0.7431979f), Position = new Vector3(0.3468902f,-0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5846751f,-0.3356836f,-0.7385604f), Position = new Vector3(0.2938926f,-0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5357918f,-0.2841708f,-0.7950938f), Position = new Vector3(0.2169443f,-0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7950939f,-0.5357918f,-0.2841708f), Position = new Vector3(0.4313343f,-0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7431979f,-0.6197611f,-0.2520974f), Position = new Vector3(0.3510232f,-0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7385604f,-0.5846751f,-0.3356836f), Position = new Vector3(0.3440955f,-0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3356836f,-0.7385604f,-0.5846751f), Position = new Vector3(0.2126627f,-0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2841708f,-0.7950939f,-0.5357918f), Position = new Vector3(0.1299459f,-0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2520974f,-0.7431979f,-0.6197611f), Position = new Vector3(0.08031102f,-0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6146943f,-0.5828831f,-0.5314115f), Position = new Vector3(0.3440955f,-0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5314115f,-0.6146943f,-0.5828831f), Position = new Vector3(0.2126627f,-0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5828831f,-0.5314114f,-0.6146943f), Position = new Vector3(0.2938926f,-0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4551857f,-0.8675708f,0.2003176f), Position = new Vector3(0.25f,-0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.1310647f,-0.9913738f,0f), Position = new Vector3(0f,-0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4551857f,-0.8675708f,-0.2003176f), Position = new Vector3(0.25f,-0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6667277f,-0.7434924f,0.05189585f), Position = new Vector3(0.3510232f,-0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6103406f,-0.7921391f,0f), Position = new Vector3(0.2628655f,-0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6667277f,-0.7434924f,-0.05189585f), Position = new Vector3(0.3510232f,-0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2077004f,-0.9188253f,0.3355901f), Position = new Vector3(0.1299459f,-0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.123731f,-0.9508986f,0.2836944f), Position = new Vector3(0f,-0.4809691f,0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2074637f,-0.9460244f,0.2489917f), Position = new Vector3(0.1314328f,-0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2074637f,-0.9460244f,-0.2489917f), Position = new Vector3(0.1314328f,-0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.123731f,-0.9508987f,-0.2836944f), Position = new Vector3(0f,-0.4809691f,-0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2077004f,-0.9188253f,-0.3355901f), Position = new Vector3(0.1299459f,-0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3284305f,-0.9431247f,0.05147159f), Position = new Vector3(0.1314328f,-0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3284304f,-0.9431247f,-0.05147159f), Position = new Vector3(0.1314328f,-0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.4117133f,-0.9113134f,0f), Position = new Vector3(0.2628655f,-0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4551857f,-0.8675708f,0.2003176f), Position = new Vector3(-0.25f,-0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4551857f,-0.8675708f,-0.2003176f), Position = new Vector3(-0.25f,-0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.1310647f,-0.9913738f,0f), Position = new Vector3(0f,-0.5f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2077005f,-0.9188252f,0.3355902f), Position = new Vector3(-0.1299459f,-0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2074637f,-0.9460244f,0.2489917f), Position = new Vector3(-0.1314328f,-0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.123731f,-0.9508986f,0.2836944f), Position = new Vector3(0f,-0.4809691f,0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6667276f,-0.7434924f,0.05189585f), Position = new Vector3(-0.3510232f,-0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6667277f,-0.7434924f,-0.05189585f), Position = new Vector3(-0.3510232f,-0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6103406f,-0.7921391f,0f), Position = new Vector3(-0.2628655f,-0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2074637f,-0.9460243f,-0.2489917f), Position = new Vector3(-0.1314328f,-0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2077004f,-0.9188253f,-0.3355901f), Position = new Vector3(-0.1299459f,-0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.123731f,-0.9508987f,-0.2836944f), Position = new Vector3(0f,-0.4809691f,-0.1366332f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.4117133f,-0.9113134f,0f), Position = new Vector3(-0.2628655f,-0.4253254f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3284305f,-0.9431247f,-0.05147159f), Position = new Vector3(-0.1314328f,-0.4755283f,-0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3284305f,-0.9431247f,0.05147159f), Position = new Vector3(-0.1314328f,-0.4755283f,0.08122993f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.412385f,-0.5361882f,0.7365059f), Position = new Vector3(-0.1545085f,-0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7365059f,-0.412385f,0.5361882f), Position = new Vector3(-0.4045085f,-0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5361882f,-0.7365059f,0.412385f), Position = new Vector3(-0.25f,-0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2520974f,-0.7431979f,0.6197611f), Position = new Vector3(-0.08031102f,-0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3356836f,-0.7385604f,0.5846751f), Position = new Vector3(-0.2126627f,-0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2841708f,-0.7950938f,0.5357918f), Position = new Vector3(-0.1299459f,-0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5357918f,-0.2841708f,0.7950939f), Position = new Vector3(-0.2169443f,-0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6197611f,-0.2520974f,0.7431979f), Position = new Vector3(-0.3468902f,-0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5846751f,-0.3356836f,0.7385604f), Position = new Vector3(-0.2938926f,-0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7385604f,-0.5846751f,0.3356836f), Position = new Vector3(-0.3440955f,-0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7950939f,-0.5357918f,0.2841708f), Position = new Vector3(-0.4313343f,-0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7431979f,-0.6197611f,0.2520974f), Position = new Vector3(-0.3510232f,-0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5828831f,-0.5314115f,0.6146943f), Position = new Vector3(-0.2938926f,-0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6146943f,-0.5828831f,0.5314115f), Position = new Vector3(-0.3440955f,-0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5314114f,-0.6146943f,0.5828831f), Position = new Vector3(-0.2126627f,-0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2003176f,-0.4551857f,0.8675708f), Position = new Vector3(0.1545085f,-0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.1310647f,0.9913738f), Position = new Vector3(0f,0f,0.5f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2003176f,-0.4551857f,0.8675708f), Position = new Vector3(-0.1545085f,-0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05189585f,-0.6667277f,0.7434924f), Position = new Vector3(0.08031102f,-0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.6103406f,0.7921391f), Position = new Vector3(0f,-0.2628655f,0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05189585f,-0.6667277f,0.7434924f), Position = new Vector3(-0.08031102f,-0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3355901f,-0.2077004f,0.9188253f), Position = new Vector3(0.2169443f,-0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2836944f,-0.123731f,0.9508986f), Position = new Vector3(0.1366332f,0f,0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2489917f,-0.2074637f,0.9460244f), Position = new Vector3(0.08122993f,-0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2489917f,-0.2074637f,0.9460244f), Position = new Vector3(-0.08122993f,-0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2836944f,-0.123731f,0.9508987f), Position = new Vector3(-0.1366332f,0f,0.4809691f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3355901f,-0.2077004f,0.9188253f), Position = new Vector3(-0.2169443f,-0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.05147159f,-0.3284305f,0.9431247f), Position = new Vector3(0.08122993f,-0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.05147159f,-0.3284304f,0.9431247f), Position = new Vector3(-0.08122993f,-0.1314328f,0.4755283f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0f,-0.4117133f,0.9113134f), Position = new Vector3(0f,-0.2628655f,0.4253254f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7365059f,-0.412385f,0.5361882f), Position = new Vector3(0.4045085f,-0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.412385f,-0.5361882f,0.7365059f), Position = new Vector3(0.1545085f,-0.25f,0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5361882f,-0.7365059f,0.412385f), Position = new Vector3(0.25f,-0.4045085f,0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7950938f,-0.5357918f,0.2841708f), Position = new Vector3(0.4313343f,-0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7385604f,-0.5846751f,0.3356836f), Position = new Vector3(0.3440955f,-0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.7431979f,-0.6197611f,0.2520974f), Position = new Vector3(0.3510232f,-0.3468902f,0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6197611f,-0.2520974f,0.7431979f), Position = new Vector3(0.3468902f,-0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5357918f,-0.2841708f,0.7950938f), Position = new Vector3(0.2169443f,-0.1299459f,0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5846751f,-0.3356836f,0.7385604f), Position = new Vector3(0.2938926f,-0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.3356836f,-0.7385604f,0.5846751f), Position = new Vector3(0.2126627f,-0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2520974f,-0.7431979f,0.6197611f), Position = new Vector3(0.08031102f,-0.3510232f,0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.2841708f,-0.7950939f,0.5357918f), Position = new Vector3(0.1299459f,-0.4313343f,0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5828831f,-0.5314114f,0.6146943f), Position = new Vector3(0.2938926f,-0.2126627f,0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.5314114f,-0.6146943f,0.5828831f), Position = new Vector3(0.2126627f,-0.3440955f,0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(0.6146943f,-0.5828831f,0.5314115f), Position = new Vector3(0.3440955f,-0.2938926f,0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8675708f,-0.2003176f,0.4551857f), Position = new Vector3(-0.4045085f,-0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8675708f,0.2003176f,0.4551857f), Position = new Vector3(-0.4045085f,0.1545085f,0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9913738f,0f,0.1310647f), Position = new Vector3(-0.5f,0f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9188252f,-0.3355902f,0.2077005f), Position = new Vector3(-0.4313343f,-0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9460244f,-0.2489917f,0.2074637f), Position = new Vector3(-0.4755283f,-0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9508986f,-0.2836944f,0.123731f), Position = new Vector3(-0.4809691f,-0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7434924f,-0.05189585f,0.6667276f), Position = new Vector3(-0.3468902f,-0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7434924f,0.05189585f,0.6667277f), Position = new Vector3(-0.3468902f,0.08031102f,0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7921391f,0f,0.6103406f), Position = new Vector3(-0.4253254f,0f,0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9460243f,0.2489917f,0.2074637f), Position = new Vector3(-0.4755283f,0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9188253f,0.3355901f,0.2077004f), Position = new Vector3(-0.4313343f,0.2169443f,0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9508987f,0.2836944f,0.123731f), Position = new Vector3(-0.4809691f,0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9113134f,0f,0.4117133f), Position = new Vector3(-0.4253254f,0f,0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9431247f,0.05147159f,0.3284305f), Position = new Vector3(-0.4755283f,0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9431247f,-0.05147159f,0.3284305f), Position = new Vector3(-0.4755283f,-0.08122993f,0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8675708f,-0.2003176f,-0.4551857f), Position = new Vector3(-0.4045085f,-0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9913738f,0f,-0.1310647f), Position = new Vector3(-0.5f,0f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.8675708f,0.2003176f,-0.4551857f), Position = new Vector3(-0.4045085f,0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7434924f,-0.05189585f,-0.6667277f), Position = new Vector3(-0.3468902f,-0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7921391f,0f,-0.6103406f), Position = new Vector3(-0.4253254f,0f,-0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7434924f,0.05189585f,-0.6667277f), Position = new Vector3(-0.3468902f,0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9188253f,-0.3355901f,-0.2077004f), Position = new Vector3(-0.4313343f,-0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9508986f,-0.2836944f,-0.123731f), Position = new Vector3(-0.4809691f,-0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9460244f,-0.2489917f,-0.2074637f), Position = new Vector3(-0.4755283f,-0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9460244f,0.2489917f,-0.2074637f), Position = new Vector3(-0.4755283f,0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9508987f,0.2836944f,-0.123731f), Position = new Vector3(-0.4809691f,0.1366332f,0f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9188253f,0.3355901f,-0.2077004f), Position = new Vector3(-0.4313343f,0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9431247f,-0.05147159f,-0.3284305f), Position = new Vector3(-0.4755283f,-0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9431247f,0.05147159f,-0.3284304f), Position = new Vector3(-0.4755283f,0.08122993f,-0.1314328f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.9113134f,0f,-0.4117133f), Position = new Vector3(-0.4253254f,0f,-0.2628655f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.412385f,0.5361882f,-0.7365059f), Position = new Vector3(-0.1545085f,0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7365059f,0.412385f,-0.5361882f), Position = new Vector3(-0.4045085f,0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5361882f,0.7365059f,-0.412385f), Position = new Vector3(-0.25f,0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2520974f,0.7431979f,-0.6197611f), Position = new Vector3(-0.08031102f,0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3356836f,0.7385604f,-0.5846751f), Position = new Vector3(-0.2126627f,0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2841708f,0.7950938f,-0.5357918f), Position = new Vector3(-0.1299459f,0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5357918f,0.2841708f,-0.7950939f), Position = new Vector3(-0.2169443f,0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6197611f,0.2520974f,-0.7431979f), Position = new Vector3(-0.3468902f,0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5846751f,0.3356836f,-0.7385604f), Position = new Vector3(-0.2938926f,0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7385604f,0.5846751f,-0.3356836f), Position = new Vector3(-0.3440955f,0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7950939f,0.5357918f,-0.2841708f), Position = new Vector3(-0.4313343f,0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7431979f,0.6197611f,-0.2520974f), Position = new Vector3(-0.3510232f,0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5828831f,0.5314115f,-0.6146943f), Position = new Vector3(-0.2938926f,0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6146943f,0.5828831f,-0.5314115f), Position = new Vector3(-0.3440955f,0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5314114f,0.6146943f,-0.5828831f), Position = new Vector3(-0.2126627f,0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7365059f,-0.412385f,-0.5361882f), Position = new Vector3(-0.4045085f,-0.1545085f,-0.25f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.412385f,-0.5361882f,-0.7365059f), Position = new Vector3(-0.1545085f,-0.25f,-0.4045085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5361882f,-0.7365059f,-0.412385f), Position = new Vector3(-0.25f,-0.4045085f,-0.1545085f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7950938f,-0.5357918f,-0.2841708f), Position = new Vector3(-0.4313343f,-0.2169443f,-0.1299459f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7385604f,-0.5846751f,-0.3356836f), Position = new Vector3(-0.3440955f,-0.2938926f,-0.2126627f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.7431979f,-0.6197611f,-0.2520974f), Position = new Vector3(-0.3510232f,-0.3468902f,-0.08031102f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6197611f,-0.2520974f,-0.7431979f), Position = new Vector3(-0.3468902f,-0.08031102f,-0.3510232f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5357918f,-0.2841708f,-0.7950938f), Position = new Vector3(-0.2169443f,-0.1299459f,-0.4313343f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5846751f,-0.3356836f,-0.7385604f), Position = new Vector3(-0.2938926f,-0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.3356836f,-0.7385604f,-0.5846751f), Position = new Vector3(-0.2126627f,-0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2520974f,-0.7431979f,-0.6197611f), Position = new Vector3(-0.08031102f,-0.3510232f,-0.3468902f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.2841708f,-0.7950939f,-0.5357918f), Position = new Vector3(-0.1299459f,-0.4313343f,-0.2169443f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5828831f,-0.5314114f,-0.6146943f), Position = new Vector3(-0.2938926f,-0.2126627f,-0.3440955f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.5314114f,-0.6146943f,-0.5828831f), Position = new Vector3(-0.2126627f,-0.3440955f,-0.2938926f) },
   new VertexPositionNormalColor() {Color = Color.White, Normal = new Vector3(-0.6146943f,-0.5828831f,-0.5314115f), Position = new Vector3(-0.3440955f,-0.2938926f,-0.2126627f) }
};

        //**************************************************
        //**************************************************

        #endregion

        #region Variables

        public GraphicsDevice Device { get; private set; }

        /// <summary>
        /// VertexBuffer
        /// </summary>
        protected VertexBuffer VB;
        /// <summary>
        /// IndexBuffer
        /// </summary>
        protected IndexBuffer IB;
        /// <summary>
        /// Color
        /// </summary>
        public Color Color { get; set; }
        /// <summary>
        /// Transform matrix 
        /// </summary>
        public Matrix Transform { get; set; }
        /// <summary>
        /// Is this mesh has alpha
        /// </summary>
        public float Alpha { get; set; }
        /// <summary>
        /// Number of face
        /// </summary>
        public int NumFace { get; protected set; }
        /// <summary>
        /// Number of vertex
        /// </summary>
        public int NumVertex { get; protected set; }
        #endregion

        #region Constructor
        /// <summary>
        /// Create a DisplayGeometry
        /// </summary>
        /// <param name="geom">geom to create mesh from</param>
        /// <param name="color">Initial color of mesh</param>
        /// <param name="transform">Initial transformation</param>
        protected DisplayGeometry(GraphicsDevice device, Color color, Matrix transform)
        {
            Device = device;
            Alpha = 1.0f;
            Color = color;
            Transform = transform;
        }
        #endregion

        #region Draw
        /// <summary>
        /// Draw geometry
        /// </summary>
        /// <param name="effect">effect to draw (must begined)</param>
        public void Draw(BasicEffect effect)
        {
            effect.World = Transform;
            effect.GraphicsDevice.Vertices[0].SetSource(VB, 0, VertexPositionNormalColor.SizeInBytes);
            effect.GraphicsDevice.Indices = IB;
            effect.DiffuseColor = Color.ToVector3();// diffuse material

            if (Alpha < 1)// has alpha
            {
                effect.Alpha = Alpha;
                //enable alpha blending
                effect.GraphicsDevice.RenderState.AlphaBlendEnable = true;
                effect.GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
                effect.GraphicsDevice.RenderState.DestinationBlend = Blend.InverseSourceAlpha;
            }
            effect.CurrentTechnique.Passes[0].Begin();
            effect.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, NumVertex,
                0, NumFace);
            effect.CurrentTechnique.Passes[0].End();
            if (Alpha < 1)// redo changed
                effect.GraphicsDevice.RenderState.AlphaBlendEnable = false;
        }
        #endregion

        #region IDisposable Members
        /// <summary>
        /// Dispose
        /// </summary>
        public virtual void Dispose()
        {
            if (VB != null)
                VB.Dispose();
            VB = null;
            if (IB != null)
                IB.Dispose();
            IB = null;
            Device = null;
        }
        #endregion
    }
    #endregion

    #region DisplayBox
    public class DisplayBox : DisplayGeometry
    {
        public Vector3 Extents { get; private set; }

        public DisplayBox(GraphicsDevice device, Color color, Vector3 extents)
            : this(device, color, Matrix.Identity, extents)
        {
        }

        public DisplayBox(GraphicsDevice device, Color color, Matrix transform, Vector3 extents)
            : base(device, color, transform)
        {
            Extents = extents;
            Matrix scale = Matrix.CreateScale(extents / 2);
            VertexPositionNormalColor[] vertices = new VertexPositionNormalColor[BoxVertices.Length];
            for (int i = 0; i < vertices.Length; i++)
            {
                vertices[i].Color = Color;
                vertices[i].Normal = BoxVertices[i].Normal;
                vertices[i].Position = Vector3.Transform(BoxVertices[i].Position, scale);
            }
            IB = new IndexBuffer(device, BoxIndices.Length * 4, BufferUsage.WriteOnly, Microsoft.Xna.Framework.Graphics.IndexElementSize.ThirtyTwoBits);
            IB.SetData<int>(BoxIndices);

            VB = new VertexBuffer(device, vertices.Length * VertexPositionNormalColor.SizeInBytes, BufferUsage.WriteOnly);
            VB.SetData<VertexPositionNormalColor>(vertices);

            NumFace = BoxIndices.Length / 3;
            NumVertex = vertices.Length;
        }
    }
    #endregion

    #region DisplaySphere
    public class DisplaySphere : DisplayGeometry
    {
        public float Radius { get; private set; }

        public DisplaySphere(GraphicsDevice device, Color color, float radius)
            : this(device, color, Matrix.Identity, radius)
        {
        }
        public DisplaySphere(GraphicsDevice device, Color color, Matrix transform, float radius)
            : base(device, color, transform)
        {
            Radius = radius;
            Matrix scale = Matrix.CreateScale(radius * 2);
            VertexPositionNormalColor[] vertices = new VertexPositionNormalColor[SphereVertices.Length];
            for (int i = 0; i < vertices.Length; i++)
            {
                vertices[i].Color = Color;
                vertices[i].Normal = SphereVertices[i].Normal;
                vertices[i].Position = Vector3.Transform(SphereVertices[i].Position, scale);
            }
            IB = new IndexBuffer(device, SphereIndices.Length * 4, BufferUsage.WriteOnly, Microsoft.Xna.Framework.Graphics.IndexElementSize.ThirtyTwoBits);
            IB.SetData<int>(SphereIndices);

            VB = new VertexBuffer(device, SphereVertices.Length * VertexPositionNormalColor.SizeInBytes, BufferUsage.WriteOnly);
            VB.SetData<VertexPositionNormalColor>(vertices);

            NumFace = SphereIndices.Length / 3;
            NumVertex = vertices.Length;
        }
    }
    #endregion

    #region DisplayTriMesh
    public class DisplayTriMesh : DisplayGeometry
    {

        public DisplayTriMesh(GraphicsDevice device, Color color, float[] vertices, uint[] indices, float[] normals)
            : this(device, color, Matrix.Identity, vertices, indices, normals)
        {
        }
        public DisplayTriMesh(GraphicsDevice device, Color color, Matrix transform, float[] vertices, uint[] indices, float[] normals)
            : base(device, color, transform)
        {
            VertexPositionNormalColor[] verts = new VertexPositionNormalColor[vertices.Length / 3];
            int index = 0;
            for (int i = 0; i < vertices.Length; i += 3)
            {
                verts[index].Color = Color;
                verts[index].Normal = new Vector3(normals[i], normals[i + 1], normals[i + 2]);
                verts[index].Position = new Vector3(vertices[i], vertices[i + 1], vertices[i + 2]);
                index++;
            }
            IB = new IndexBuffer(device, indices.Length * 4, BufferUsage.WriteOnly, Microsoft.Xna.Framework.Graphics.IndexElementSize.ThirtyTwoBits);
            IB.SetData<uint>(indices);

            VB = new VertexBuffer(device, verts.Length * VertexPositionNormalColor.SizeInBytes, BufferUsage.WriteOnly);
            VB.SetData<VertexPositionNormalColor>(verts);

            NumFace = indices.Length / 3;
            NumVertex = verts.Length;
        }
    }
    #endregion

    #region DisplaySphere
    public class DisplayCylinder : DisplayGeometry
    {
        public float Radius { get; private set; }
        public float Length { get; private set; }

        public DisplayCylinder(GraphicsDevice device, Color color, float radius, float length)
            : this(device, color, Matrix.Identity, radius, length)
        {
        }
        public DisplayCylinder(GraphicsDevice device, Color color, Matrix transform, float radius, float length)
            : base(device, color, transform)
        {
            Radius = radius;
            Length = length;
            Matrix scale = Matrix.CreateScale(radius * 2, length, radius * 2);
            VertexPositionNormalColor[] vertices = new VertexPositionNormalColor[CylinderVertices.Length];
            for (int i = 0; i < vertices.Length; i++)
            {
                vertices[i].Color = Color;
                vertices[i].Normal = CylinderVertices[i].Normal;
                vertices[i].Position = Vector3.Transform(CylinderVertices[i].Position, scale);
            }
            IB = new IndexBuffer(device, CylinderIndices.Length * 4, BufferUsage.WriteOnly, Microsoft.Xna.Framework.Graphics.IndexElementSize.ThirtyTwoBits);
            IB.SetData<int>(CylinderIndices);

            VB = new VertexBuffer(device, vertices.Length * VertexPositionNormalColor.SizeInBytes, BufferUsage.WriteOnly);
            VB.SetData<VertexPositionNormalColor>(vertices);

            NumFace = CylinderIndices.Length / 3;
            NumVertex = vertices.Length;
        }
    }
    #endregion
}
